#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <ctime>
using namespace std;
    int a[100];
int main(){ 
    srand(time(nullptr));

    int n; cin >> n;
    for (int i = 0; i < n; i++){
        a[i] = rand() % 10 + 1;
    }
    cout << "================== before being sorted =============\n" ;
        for (int i = 0; i <= n; i++){
        cout << a[i] << " ";
    }
    cout << "\n";
    sort(a, a + n);
    cout << "================== after being sorted =============\n" ;
    for (int i = 0; i < n; i++){
        cout << a[i] << " ";
    }
    cout << endl;
    return 0;
}